package javaqueue;

import harness.Queue;
import harness.Random;
import java.util.concurrent.ArrayBlockingQueue;

public class JavaQueueAdapter<E> implements Queue {
    ArrayBlockingQueue<E> q;
    
    public JavaQueueAdapter(int capacity) {
        q = new ArrayBlockingQueue<E>(capacity);
    }
    
    public Object poll(int threadId, Random rng) {
        return q.poll();
    }

    public boolean offer(Object e, int threadId, Random rng) {
        return q.offer((E) e);
    }
    
}
